package com.xuecheng.learning.controller;


import com.xuecheng.base.util.SecurityUtil;
import com.xuecheng.learning.model.dto.XcChooseCourseDTO;
import com.xuecheng.learning.model.dto.XcCourseTablesDTO;
import com.xuecheng.learning.service.IXcChooseCourseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 勾新杰
 * @since 2025-02-26
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "选课管理接口")
public class XcChooseCourseController {

    /**
     * 选课服务
     */
    private final IXcChooseCourseService chooseCourseService;

    /**
     * 添加选课
     * @param courseId 课程id
     * @return 选课记录以及选课状态
     */
    @ApiOperation("添加选课")
    @PostMapping("/choosecourse/{courseId}")
    public XcChooseCourseDTO addChooseCourse(@PathVariable("courseId") Long courseId) {
        return chooseCourseService.addChooseCourse(courseId);
    }
}
